@import '../libs/vars';
@import '../libs/functions';
@import '../libs/mixins';

///
/// Slate by Pixelarity
/// pixelarity.com @pixelarity
/// License: pixelarity.com/license
///

/* Type */

	body {
		background-color: _palette(bg);
		color: _palette(fg);
	}

	body, input, select, textarea {
		font-family: _font(family);
		font-size: 13pt;
		font-weight: _font(weight);
		line-height: 1.55em;

		@include breakpoint(xlarge) {
			font-size: 11pt;
		}
	}

	a {
		@include vendor('transition', 'border-bottom-color #{_duration(transition)} ease-in-out');
		border-bottom: dotted 1px;
		text-decoration: none;
		padding-bottom: 0.05em;

		&:hover {
			border-bottom-color: transparent;
		}
	}
	a.imagelink, a.lb-next, a.lb-prev, a.lb-close {
		border-bottom: none !important;
	}

	strong, b {
		font-weight: _font(weight-bold);
	}

	em, i {
		font-style: italic;
	}

	p {
		margin: 0 0 (_size(element-margin) * 0.5) 0;
	}

	h1, h2, h3, h4, h5, h6 {
		font-family: _font(family-heading);
		font-weight: _font(weight-heading-bold);
		line-height: 1em;
		margin: 0 0 (_size(element-margin) * 0.5) 0;
		position: relative;
		overflow: auto;

		a {
			border-bottom: 0;
			color: inherit;
			text-decoration: none;
		}

		&.alt {
			margin: 0 0 (_size(element-margin) * 0.5) 0;
			padding-bottom: 0;

			&:after {
				display: none;
			}
		}
	}

	h1 {
		font-size: 2.0em;
		line-height: 1.7em;
		color: #000;
		border-bottom: solid 1px _palette(border);
	}

	h2 {
		font-size: 1.5em;
		line-height: 1.5em;
		color: #000;
		border-bottom: solid 1px _palette(border);
	}

	h3 {
		font-size: 1.2em;
		line-height: 1.5em;
		color: #000;
	}

	h4 {
		font-size: 0.9em;
		line-height: 1.5em;
		color: #444;
	}

	h5 {
		font-size: 0.8em;
		line-height: 1.5em;
		color: #666;
	}

	h6 {
		font-size: 0.7em;
		line-height: 1.5em;
		color: #666;
	}

	@include breakpoint(small) {
		h2 {
			line-height: 1.5em;
		}
	}

	sub {
		font-size: 0.8em;
		position: relative;
		top: 0.5em;
	}

	sup {
		font-size: 0.8em;
		position: relative;
		top: -0.5em;
	}

	blockquote {
		border-left: solid 4px;
		font-style: italic;
		margin: 0 0 _size(element-margin) 0;
		padding: (_size(element-margin) / 4) 0 (_size(element-margin) / 4) _size(element-margin);
	}

	code {
		border: solid 1px;
		font-family: _font(family-fixed);
		font-size: 0.8em;
		margin: 0 0.15em;
		padding: 0 0.15em;
	}

	pre {
		-webkit-overflow-scrolling: touch;
		font-family: _font(family-fixed);
		font-size: 0.9em;
		margin: 0 0 _size(element-margin) 0;

		code {
			display: block;
			line-height: 1.75em;
			padding: 1em 1.5em;
			overflow-x: auto;
		}
	}

	hr {
		border: 0;
		border-bottom: solid 1px;
		margin: _size(element-margin) 0;

		&.major {
			margin: (_size(element-margin) * 1.5) 0;
		}
	}

	.align-left {
		text-align: left;
	}

	.align-center {
		text-align: center;
	}

	.align-right {
		text-align: right;
	}

	@mixin color-typography($p: null) {
		$highlight: _palette($p, highlight);

		@if $p != null {
			background-color: _palette($p, bg);
			color: _palette($p, fg);
		}

		input, select, textarea {
			color: _palette($p, fg-bold);
		}

		a {
			@if $p == $highlight {
				color: _palette($p, fg-bold);
			}
			@else {
				color: _palette(accent1, bg);
			}
		}

		strong, b {
			color: _palette($p, fg-bold);
		}

		blockquote {
			border-left-color: _palette($p, border);
		}

		code {
			background: _palette($p, border-bg);
			border-color: _palette($p, border);
		}

		hr {
			border-bottom-color: _palette($p, border);
		}
	}

	@include color-typography;
